Use GitHub MCP server with dynamic repo context in code-scanning-fixer workflow#10164
Merged
Use GitHub MCP server with dynamic repo context in code-scanning-fixer workflow#10164
Conversation
- Use GitHub MCP server's list_code_scanning_alerts with severity parameter
- Replace hardcoded owner/repo with dynamic context variables
- Use ${{ github.repository_owner }} for owner
- Extract repo name from ${{ github.repository }}
- Apply high severity filtering via MCP tool parameter instead of post-filtering
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update list_code_scanning_alerts parameters for owner and repo
Use GitHub MCP server with dynamic repo context in code-scanning-fixer workflow
Jan 16, 2026
eaftan
approved these changes
Jan 16, 2026
pelikhan
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
code-scanning-fixerworkflow was instructing the AI to use the GitHub API directly with unspecified owner/repo parameters. Updated to use GitHub MCP server tools with dynamic context variables.Changes:
list_code_scanning_alertsfrom GitHub MCP server instead of direct API references${{ github.repository_owner }}for owner and extraction pattern for repo from${{ github.repository }}severity: highparameter directly in MCP tool call instead of post-filtering resultslist_code_scanning_alerts,get_code_scanning_alert, andget_file_contentscallsBefore:
After:
The workflow frontmatter already configures the GitHub MCP server via
tools.github.toolsets: [code_security].Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.